using Microsoft.AspNetCore.Mvc;
using SharedKernel.Infrastructure.Comm;
using System;
using System.Threading.Tasks;
using UserService.Application.DTOs;
using UserService.Controllers;
using UserService.Domain.Models;
using UserService.Domain.ValueObjects;

namespace UserService.Application.Services
{
    /// <summary>
    /// 用户应用服务接口
    /// </summary>
    public interface IUserAppService
    {
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <returns>用户实体</returns>
        Task<User> GetUserAsync(long id);
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<ResponseInfo<UserLoginResInfo>> UserLogin(UserLoginRequest request);
        /// <summary>
        /// 根据用户名获取用户
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns>用户实体</returns>
        Task<User> GetUserByUsernameAsync(string username);

        /// <summary>
        /// 创建用户
        /// </summary>
        /// <param name="data"></param> 
        /// <returns>创建的用户ID</returns>
        Task<long> CreateUserAsync(CreateUserRequest data);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <param name="data">更新数据</param> 
        Task UpdateUserAsync(long id,UpdateUserRequest data);

        /// <summary>
        /// 更改密码
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <param name="newPasswordHash">新密码哈希</param>
        Task ChangePasswordAsync(long id, string newPasswordHash);
    }
}